package ahot;

import java.util.Stack;

public class MyQueue {
    Stack<Integer> s1;
    Stack<Integer> s2;

    public MyQueue(){
        s1 = new Stack<>();
        s2 = new Stack<>();
    }

    public void  push(int integer){
        s1.push(integer);
    }

    public int pop(){
        if (s2.isEmpty()){
            while (!s1.isEmpty()){
                s2.push(s1.pop());
            }
        }
        Integer pop = s2.pop();
        return pop;
    }

}
